﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace 徐汉权
{
    public partial class Login : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            var username = TextBox1.Text.TrimEnd();
            var userpwd = TextBox2.Text.TrimEnd();
            var sqlser = string.Format("select * from Users where Username = '{0}' and Password = '{1}'",username,userpwd);
            var bt = Dbepr.dataTable(sqlser);
            if (bt.Rows.Count == 1 ) 
            {
                Dbepr.dataTable(sqlser);
                Response.Write("登录成功");
                Response.Redirect("Default.aspx");
            }
            else 
            {
            
            }
        }

        protected void Button2_Click(object sender, EventArgs e)
        {
            Response.Redirect("Register.aspx");
        }
    }
}